home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
one-check.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
3KB
|
114 lines
<!NOWIZARD>
<!TITLE>One Check
<!/TITLE>
<!DESCRIPTION>Only allow one box to be checked out of any number of boxes. Handy for quizzes, etc. <!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL ONE CHECK:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<script type="text/javascript">
<!-- Original: Mike Best (http://www.hei-usa.com) -->
<!-- Begin
function checkBoxValidate(cb) {
for (j = 0; j < 8; j++) {
if (eval("document.myform.ckbox[" + j + "].checked") == true) {
document.myform.ckbox[j].checked = false;
if (j == cb) {
document.myform.ckbox[j].checked = true;
}
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form name=myform>
Selection 1<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(0)"><br>
Selection 2<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(1)"><br>
Selection 3<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(2)"><br>
Selection 4<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(3)"><br>
Selection 5<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(4)"><br>
Selection 6<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(5)"><br>
Selection 7<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(6)"><br>
Selection 8<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(7)"><br>
</form>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL ONE CHECK:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<script type="text/javascript">
<!-- Original: Mike Best (http://www.hei-usa.com) -->
<!-- Begin
function checkBoxValidate(cb) {
for (j = 0; j < 8; j++) {
if (eval("document.myform.ckbox[" + j + "].checked") == true) {
document.myform.ckbox[j].checked = false;
if (j == cb) {
document.myform.ckbox[j].checked = true;
}
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form name=myform>
Selection 1<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(0)"><br>
Selection 2<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(1)"><br>
Selection 3<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(2)"><br>
Selection 4<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(3)"><br>
Selection 5<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(4)"><br>
Selection 6<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(5)"><br>
Selection 7<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(6)"><br>
Selection 8<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(7)"><br>
</form>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>